Skip to content

Fix web/index.html duplication and implement deterministic sync#31

Merged
solveforceapp merged 2 commits intomainfrom
copilot/fix-web-index-html-sync
Nov 13, 2025
Merged

Fix web/index.html duplication and implement deterministic sync#31
solveforceapp merged 2 commits intomainfrom
copilot/fix-web-index-html-sync

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 13, 2025

web/index.html contained duplicate closing tags and script blocks causing CI failures in test_root_assets.py.

Changes

  • web/index.html: Removed duplicate </body></html> and script tags (lines 93-99)
  • tools/sync_root.py: Replaced custom copy logic with shutil.copyfile() for deterministic web/ → root sync
  • .github/workflows/ci.yml: Added sync step before pytest to ensure deterministic test state
  • .pre-commit-config.yaml: Added local hook to prevent future divergence

Before

<!-- web/index.html line 91-99 -->
    <!-- Load the shared JavaScript asset referenced by both root and /web pages. -->
    <script src="scripts.js"></script>
</body>
</html>
    <script src="web/scripts.js"></script>
    <script src="scripts.js"></script>
</body>
</html>

After

<!-- web/index.html line 91-96 -->
    <!-- Load the shared JavaScript asset referenced by both root and /web pages. -->
    <script src="web/scripts.js"></script>
    <script src="scripts.js"></script>
</body>
</html>

The sync direction (web/ → root) prevents accidental duplication from manual edits to root files.

Original prompt

Problem: A CI job fails because web/index.html and index.html at the repository root are out-of-sync. web/index.html contains a duplicated trailing script block and duplicate closing tags which caused the root vs web files to differ and tests/tests_root_assets.py to fail. We need a permanent fix that prevents regressions.

Changes to implement (create a branch and PR):

  1. Fix web/index.html so it is canonical (remove duplicated blocks and ensure both expected script tags appear once in the intended location). Replace web/index.html contents with the canonical index.html content (matching the repository root index.html).

New content for web/index.html (use this exact content):

<title>ATOM | Adaptive Telecom Operations Module | SolveForce</title>

ATOM

Adaptive Telecom Operations Module by SolveForce

Overview Capabilities Coverage Contact
<main class="sf-main sf-container">
    <section id="overview" class="sf-section">
        <h2>What is ATOM?</h2>
        <p>
            ATOM is the intelligence layer of SolveForce�s telecom ecosystem:
            a modular framework that maps connectivity, services, and infrastructure
            into a coherent, language-aligned system. From fiber and wireless to
            cloud and data centers, ATOM organizes the signals that keep businesses online.
        </p>
    </section>

    <section id="capabilities" class="sf-section">
        <h2>Core Capabilities</h2>
        <div class="grid">
            <div class="card">
                <h3>Carrier Intelligence</h3>
                <p>Index carriers, service tiers, and last-mile options with consistent terminology.</p>
            </div>
            <div class="card">
                <h3>Network Mapping</h3>
                <p>Model fiber, wireless, satellite, and hybrid connectivity paths across regions.</p>
            </div>
            <div class="card">
                <h3>Edge &amp; IoT Ready</h3>
                <p>Support for edge devices, sensors, and IoT endpoints in a unified framework.</p>
            </div>
            <div class="card">
                <h3>AI-Assisted Insights</h3>
                <p>Future-ready design for AI-based diagnostics, optimization, and capacity planning.</p>
            </div>
        </div>
    </section>

    <section id="coverage" class="sf-section">
        <h2>Coverage &amp; Reach</h2>
        <p>
            ATOM is designed to integrate with SolveForce�s nationwide and international
            reach, aligning local access, long-haul, and cloud adjacency under a single
            architectural language.
        </p>
        <ul>
            <li>Nationwide fiber and broadband availability</li>
            <li>Rural and metro wireless solutions</li>
            <li>Cloud and data center access points</li>
            <li>Support for future AMR-powered data center modules</li>
        </ul>
    </section>

    <section id="contact" class="sf-section">
        <h2>Connect with SolveForce</h2>
        <p>
            To learn how ATOM and SolveForce can support your telecom and infrastructure needs,
            call <strong>(888) 765-8301</strong> or visit
            <a href="https://solveforce.com" target="_blank" rel="noopener">solveforce.com</a>.
        </p>
    </section>
</main>

<footer class="sf-footer">
    <div class="sf-container">
        <p>�A9 2025 SolveForce. ATOM � Adaptive Telecom Operations Module.</p>
    </div>
</footer>

<!-- Load the shared JavaScript asset referenced by both root and /web pages. -->
<script src="web/scripts.js"></script>
<script src="scripts.js"></script>
  1. Add deterministic sync module at tools/sync_root.py. File content (exact):
    from pathlib import Path
    import shutil
    from . import ROOT, WEB_DIR, SYNCED_FILES

def sync_root() -> None:
"""Deterministically copy SYN...

This pull request was created as a result of the following prompt from Copilot chat.

Problem: A CI job fails because web/index.html and index.html at the repository root are out-of-sync. web/index.html contains a duplicated trailing script block and duplicate closing tags which caused the root vs web files to differ and tests/tests_root_assets.py to fail. We need a permanent fix that prevents regressions.

Changes to implement (create a branch and PR):

  1. Fix web/index.html so it is canonical (remove duplicated blocks and ensure both expected script tags appear once in the intended location). Replace web/index.html contents with the canonical index.html content (matching the repository root index.html).

New content for web/index.html (use this exact content):

<title>ATOM | Adaptive Telecom Operations Module | SolveForce</title>

ATOM

Adaptive Telecom Operations Module by SolveForce

Overview Capabilities Coverage Contact
<main class="sf-main sf-container">
    <section id="overview" class="sf-section">
        <h2>What is ATOM?</h2>
        <p>
            ATOM is the intelligence layer of SolveForce�s telecom ecosystem:
            a modular framework that maps connectivity, services, and infrastructure
            into a coherent, language-aligned system. From fiber and wireless to
            cloud and data centers, ATOM organizes the signals that keep businesses online.
        </p>
    </section>

    <section id="capabilities" class="sf-section">
        <h2>Core Capabilities</h2>
        <div class="grid">
            <div class="card">
                <h3>Carrier Intelligence</h3>
                <p>Index carriers, service tiers, and last-mile options with consistent terminology.</p>
            </div>
            <div class="card">
                <h3>Network Mapping</h3>
                <p>Model fiber, wireless, satellite, and hybrid connectivity paths across regions.</p>
            </div>
            <div class="card">
                <h3>Edge &amp; IoT Ready</h3>
                <p>Support for edge devices, sensors, and IoT endpoints in a unified framework.</p>
            </div>
            <div class="card">
                <h3>AI-Assisted Insights</h3>
                <p>Future-ready design for AI-based diagnostics, optimization, and capacity planning.</p>
            </div>
        </div>
    </section>

    <section id="coverage" class="sf-section">
        <h2>Coverage &amp; Reach</h2>
        <p>
            ATOM is designed to integrate with SolveForce�s nationwide and international
            reach, aligning local access, long-haul, and cloud adjacency under a single
            architectural language.
        </p>
        <ul>
            <li>Nationwide fiber and broadband availability</li>
            <li>Rural and metro wireless solutions</li>
            <li>Cloud and data center access points</li>
            <li>Support for future AMR-powered data center modules</li>
        </ul>
    </section>

    <section id="contact" class="sf-section">
        <h2>Connect with SolveForce</h2>
        <p>
            To learn how ATOM and SolveForce can support your telecom and infrastructure needs,
            call <strong>(888) 765-8301</strong> or visit
            <a href="https://solveforce.com" target="_blank" rel="noopener">solveforce.com</a>.
        </p>
    </section>
</main>

<footer class="sf-footer">
    <div class="sf-container">
        <p>�A9 2025 SolveForce. ATOM � Adaptive Telecom Operations Module.</p>
    </div>
</footer>

<!-- Load the shared JavaScript asset referenced by both root and /web pages. -->
<script src="web/scripts.js"></script>
<script src="scripts.js"></script>
  1. Add deterministic sync module at tools/sync_root.py. File content (exact):
    from pathlib import Path
    import shutil
    from . import ROOT, WEB_DIR, SYNCED_FILES

def sync_root() -> None:
"""Deterministically copy SYNCED_FILES from web/ to repository root,
overwriting any existing root copy.
"""
for rel in SYNCED_FILES:
src = WEB_DIR / rel
dst = ROOT / rel
if not src.exists():
raise FileNotFoundError(f"Expected web asset missing: {src}")
dst.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(src, dst)

if name == "main":
sync_root()

  1. Update CI: modify .github/workflows/ci.yml to run the sync before tests. Add the step before running pytest:
  • name: Sync root assets
    run: python -m tools.sync_root
  1. Add a pre-commit config file .pre-commit-config.yaml to run sync locally as a local hook (optional but included):
    repos:
  • repo: local
    hooks:
    • id: sync-root-assets
      name: Sync root assets (local)
      entry: python -m tools.sync_root
      language: system
      stages: [pre-commit, pre-push]

Rationale: The deterministic sync prevents accidental appends/duplications; fixing web/index.html removes the immediate mismatch; running the sync in CI guarantees tests run against a deterministic, synced state; pre-commit prevents local regressions.

Please create a branch named: fix/sync-root-and-web-index and open a pull request with title: "Deterministic sync + fix duplicated scripts in web/index.html". Include a clear PR description summarizing the above.

Do not include any extra files beyond the ones listed. Ensure the PR updates web/index.html, adds tools/sync_root.py, updates .github/workflows/ci.yml, and adds .pre-commit-config.yaml.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: solveforceapp <98552991+solveforceapp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix synchronization issue between web/index.html and root index.html Fix web/index.html duplication and implement deterministic sync Nov 13, 2025
Copilot AI requested a review from solveforceapp November 13, 2025 20:30
@solveforceapp solveforceapp marked this pull request as ready for review November 13, 2025 20:42
@solveforceapp solveforceapp merged commit ff4baa6 into main Nov 13, 2025
4 checks passed
@solveforceapp solveforceapp deleted the copilot/fix-web-index-html-sync branch November 13, 2025 20:42
Copy link
Copy Markdown
Owner

@solveforceapp solveforceapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants